import React, { Component } from 'react';
import styles from './PayDebt.less';
import PropTypes from 'prop-types';
import { connect } from 'dva';
import TabsChart from './components/TabsChart';

/**
 * 偿债分析
 */
class PayDebt extends Component {
  componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
      type: 'finance/getCharts',
      payload: {
        dataType: 'PayDebt',
        descKey: 'zc',
      },
    });
  }

  render() {
    const tabs = [
      {
        tab: '资产负债率',
        key: 0,
      },
      {
        tab: '流动比率',
        key: 1,
      },
      {
        tab: '速动比率',
        key: 2,
      },
      {
        tab: '流动资产/总资产',
        key: 3,
      },
      {
        tab: '商誉/总资产',
        key: 4,
      },
      {
        tab: '有形资产/总资产',
        key: 5,
      },
      {
        tab: '流动负债/负债合计',
        key: 6,
      },
      {
        tab: '经营活动产生的现金流量净额/流动负债',
        key: 7,
      },
      {
        tab: '经营活动产生的现金流量净额/负债合计',
        key: 8,
      },
      {
        tab: '已获利息倍数（EBIT/利息费用）',
        key: 9,
      },
    ];
    return <TabsChart tabs={tabs} />;
  }
}

export default connect()(PayDebt);
